import webapp2

from google.appengine.api import taskqueue


class StartCleanup(webapp2.RequestHandler):
  # TODO(flamingcow): Build a UI and make this POST
  def get(self):
    queue = taskqueue.Queue(name='cleanup')
    queue.purge()
    taskqueue.add(queue_name='cleanup',
                  url='/services/deleteIdleChannels')
    self.response.out.write('OK')


app = webapp2.WSGIApplication([
  ('/admin/startCleanup', StartCleanup),
])
